<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改核算码')" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-info-edit" th:object="${smSrnInfo}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">核算码：</label>
                <div class="col-sm-8">
                    <input name="srnInfo" th:field="*{srnInfo}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">核算码类型：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sm_srn_info_type')}">
                        <input type="radio" th:id="${dict.dictCode}" name="srnType" th:value="${dict.dictValue}" th:checked="${dict.default}" th:field="*{srnType}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">控制金额：</label>
                <div class="col-sm-8">
                    <input name="amount" th:field="*{amount}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">核算码描述：</label>
                <div class="col-sm-8">
                    <input name="comments" th:field="*{comments}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">账户余额控制方向：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('para_debit_credit')}">
                        <input type="radio" th:id="${dict.dictCode}" name="balanceType" th:value="${dict.dictValue}" th:checked="${dict.default}" th:field="*{balanceType}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开户层级控制：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sm_srn_info_bank_type')}">
                        <input type="radio" th:id="${dict.dictCode}" name="bankType" th:value="${dict.dictValue}" th:checked="${dict.default}" th:field="*{bankType}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">账户借贷控制：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('para_debit_credit')}">
                        <input type="radio" th:id="${dict.dictCode}" name="accType" th:value="${dict.dictValue}" th:checked="${dict.default}" th:field="*{accType}">
                        <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">监督类型：</label>
                <div class="col-sm-8">
                    <select id="auType" name="auType" class="form-control select2-single">
                        <option></option>
                        <option th:each="auType:${auTypes}" th:value="${auType.code}" th:text="${auType.code+'-'+auType.name}" th:selected="${auType.remark}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">渠道标示：</label>
                <div class="col-sm-8">
                    <input name="channel" th:field="*{channel}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">渠道区间：</label>
                <div class="radio-box" th:each="dict : ${@dict.getType('sm_srn_info_channel_flag')}">
                    <input type="radio" th:id="${dict.dictCode}" name="flag" th:value="${dict.dictValue}" th:checked="${dict.default}" th:field="*{flag}">
                    <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: select2-js" />
    <script type="text/javascript">
        var prefix = ctx + "para/srn";
        $("#form-info-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-info-edit').serialize());
            }
        }
    </script>
</body>
</html>